package com.atstudent.gmall.common.result;

import lombok.Getter;

/**
 * 统一返回结果状态信息类
 *
 */
@Getter
public enum ResultCodeEnum {

    SUCCESS(200,"成功"),
    FAIL(201, "失败"),
    SERVICE_ERROR(2012, "服务异常"),

    PAY_RUN(205, "支付中"),

    LOGIN_AUTH(208, "未登陆"),
    PERMISSION(209, "没有权限"),
    SECKILL_NO_START(210, "秒杀还没开始"),
    SECKILL_RUN(211, "正在排队中"),
    SECKILL_NO_PAY_ORDER(212, "您有未支付的订单"),
    SECKILL_FINISH(213, "已售罄"),
    SECKILL_END(214, "秒杀已结束"),
    SECKILL_SUCCESS(215, "抢单成功"),
    SECKILL_FAIL(216, "抢单失败"),
    SECKILL_ILLEGAL(217, "请求不合法"),
    SECKILL_ORDER_SUCCESS(218, "下单成功"),
    COUPON_GET(220, "优惠券已经领取"),
    COUPON_LIMIT_GET(221, "优惠券已发放完毕"),

    ERROR_SPU_REF(311, "被SPU所引用"),
    ERROR_SKU_REF(312, "被SKU所引用"),
    SYS_ERROR(9999, "您的网络有问题，请稍后重试！"),
    REDIS_DATA_ERROR(412 , "请通过正常途径进行访问"),
    LOGIN_ERROR(433 , "用户名或者密码错误!"),
    ORDER_REPT(9004 , "表单重复提交了") ,
    CART_ITEM_NUMBER_ERROR(9001 , "购买数量超过了限制，无法进行购买!"),
    SKU_PRICE_ERROR(9005 , "商品价格变更了，请重新查询购物车数据!"),
    SKU_STOCK_ERROR(9006 , "存在没有库存的商品，请重新选择!")
    ;

    private Integer code;

    private String message;

    private ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
